home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{BDBA7F3D-D7B4-11D1-A28B-00C04FA30E7F}#1.0#0"; "DRSD.dll"
- Begin VB.Form Form1
- Caption = "DameWare Remote Shut Down Sample"
- ClientHeight = 5400
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 6255
- LinkTopic = "Form1"
- ScaleHeight = 5400
- ScaleWidth = 6255
- StartUpPosition = 2 'CenterScreen
- Begin VB.CommandButton Command3
- Caption = "EXIT"
- Height = 375
- Left = 4560
- TabIndex = 10
- Top = 4920
- Width = 1455
- End
- Begin VB.CommandButton Command2
- Caption = "Abort"
- Height = 375
- Left = 4560
- TabIndex = 9
- Top = 4320
- Width = 1455
- End
- Begin VB.TextBox Text5
- Height = 375
- IMEMode = 3 'DISABLE
- Left = 3720
- PasswordChar = "*"
- TabIndex = 2
- Top = 1320
- Width = 2415
- End
- Begin VB.TextBox Text4
- Height = 375
- Left = 3720
- TabIndex = 1
- Top = 600
- Width = 2415
- End
- Begin VB.TextBox Text3
- Height = 1335
- Left = 240
- MultiLine = -1 'True
- TabIndex = 7
- Top = 3960
- Width = 4095
- End
- Begin VB.TextBox Text2
- Height = 375
- Left = 360
- TabIndex = 6
- Top = 3000
- Width = 975
- End
- Begin VB.CheckBox Check3
- Caption = "Use Control Dialog"
- Height = 255
- Left = 360
- TabIndex = 5
- Top = 2160
- Width = 2775
- End
- Begin VB.CheckBox Check2
- Caption = "&Kill Applications Without Saving Data"
- Height = 255
- Left = 360
- TabIndex = 4
- Top = 1800
- Width = 3135
- End
- Begin VB.CheckBox Check1
- Caption = "Reboot After Shutdown"
- Height = 255
- Left = 360
- TabIndex = 3
- Top = 1440
- Width = 2175
- End
- Begin VB.TextBox Text1
- Height = 375
- Left = 360
- TabIndex = 0
- Top = 600
- Width = 1815
- End
- Begin VB.CommandButton Command1
- Caption = "ShutDown"
- Default = -1 'True
- Height = 375
- Left = 4560
- TabIndex = 8
- Top = 3720
- Width = 1455
- End
- Begin DRSDLibCtl.DRSDCtl DRSDCtl1
- Height = 480
- Left = 2760
- TabIndex = 11
- Top = 0
- Width = 480
- Machine = ""
- UserID = ""
- Password = ""
- ShutDownMessage = "Your computer is being shut down. Save any work that may be lost!"
- ShutDownDelay = 30
- ShutDownForceAppsClosed= 0
- RebootAfterShutdown= 1
- ShutDownUseDialog= 0
- End
- Begin VB.Label Label5
- Caption = "Password"
- Height = 255
- Left = 3720
- TabIndex = 16
- Top = 1080
- Width = 2415
- End
- Begin VB.Label Label4
- Caption = "UserID"
- Height = 255
- Left = 3720
- TabIndex = 15
- Top = 360
- Width = 2175
- End
- Begin VB.Label Label3
- Caption = "Enter message to display in the shutdown dialog box."
- Height = 255
- Left = 240
- TabIndex = 14
- Top = 3720
- Width = 3975
- End
- Begin VB.Label Label2
- Caption = "Delay in seconds"
- Height = 255
- Left = 360
- TabIndex = 13
- Top = 2760
- Width = 1215
- End
- Begin VB.Label Label1
- Caption = "Machine Name"
- Height = 255
- Left = 360
- TabIndex = 12
- Top = 360
- Width = 1815
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub Command1_Click()
- On Error GoTo ErrorHandler
- Dim ConnectFlag
- ConnectFlag = False
- DRSDCtl1.Machine = Text1.Text
- DRSDCtl1.RebootAfterShutdown = Check1.Value
- DRSDCtl1.ShutDownForceAppsClosed = Check2.Value
- If DRSDCtl1.Machine <> DRSDCtl1.GetLocalMachineName Then
- ConnectFlag = True
- DRSDCtl1.UserID = Text4.Text
- DRSDCtl1.Password = Text5.Text
- DRSDCtl1.UserConnect
- End If
- If Check3.Value = 1 Then
- DRSDCtl1.ShutDownUseDialog = True
- Else
- DRSDCtl1.ShutDownUseDialog = False
- End If
- DRSDCtl1.ShutDownMessage = Text3.Text
- DRSDCtl1.ShutDownDelay = Text2.Text
- If DRSDCtl1.ShutDown <> 0 Then
- s = "The machine [ " + DRSDCtl1.Machine + " ] has accepted the Shutdown request."
- MsgBox s, vbInformation, "Information"
- End If
- If ConnectFlag = True Then
- DRSDCtl1.UserDisconnect
- End If
- Exit Sub
- ErrorHandler:
- OnErrorHandler
- 'Resume Next
- End Sub
- Private Sub Command2_Click()
- On Error GoTo ErrorHandler
- Dim ConnectFlag
- ConnectFlag = False
- DRSDCtl1.Machine = Text1.Text
- If DRSDCtl1.Machine <> DRSDCtl1.GetLocalMachineName Then
- ConnectFlag = True
- DRSDCtl1.UserID = Text4.Text
- DRSDCtl1.Password = Text5.Text
- DRSDCtl1.UserConnect
- End If
- If DRSDCtl1.ShutDownAbort <> 0 Then
- s = "The machine [ " + DRSDCtl1.Machine + " ] has accepted the request to Abort."
- MsgBox s, vbInformation, "Information"
- End If
- If ConnectFlag = True Then
- DRSDCtl1.UserDisconnect
- End If
- Exit Sub
- ErrorHandler:
- OnErrorHandler
- 'Resume Next
- End Sub
- Private Sub Command3_Click()
- End
- End Sub
- Private Sub Form_Load()
- Text1.Text = DRSDCtl1.GetLocalMachineName
- Text4.Text = DRSDCtl1.GetCurrentUserID
- Check1.Value = 1
- Check2.Value = 0
- Text2.Text = DRSDCtl1.ShutDownDelay
- Text3.Text = "Your computer is being shut down. Save any work that may be lost!"
- End Sub
- Sub OnErrorHandler()
- If Err.Number <> 0 Then
- MsgBox Err.Description, , "Error"
- End If
- End Sub
-